/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pe.gov.mtc.dgac.licencias.persistence;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.orm.ibatis.SqlMapClientTemplate;
import pe.gov.mtc.dgac.licencias.bean.ClienteTO;
import pe.gov.mtc.dgac.licencias.bean.PaisTO;
import pe.gov.mtc.dgac.licencias.bean.UbigeoTO;
import pe.gov.mtc.dgac.licencias.exception.TransactionException;
import pe.gov.mtc.dgac.licencias.util.Page;

/**
 *
 * @author German
 */
public class UbigeoImplDAO extends SqlMapClientTemplate implements UbigeoDAO {

   
    public List<UbigeoTO> listUbigeo(Long ubigeoid) throws TransactionException {
         List<UbigeoTO> list=null;
    
      try{
          Map<String, Object> parmMap = new HashMap<String, Object>();
			
	  parmMap.put("pUbigeoId",ubigeoid); 
          
          queryForObject("Ubigeo.listUbigeo", parmMap);
          list=(List<UbigeoTO>)parmMap.get("pResult");
          
          
      }catch(Exception e){
        e.printStackTrace();
	logger.error(e);
      }
       return list;
    }

    public List<PaisTO> listPaises(String codpais) throws TransactionException {
      List<PaisTO> list=null;
    
      try{
          Map<String, Object> parmMap = new HashMap<String, Object>();
			
	  parmMap.put("pCodPais",codpais); 
          
          queryForObject("Ubigeo.listPaises", parmMap);
          list=(List<PaisTO>)parmMap.get("pResult");
          
          
      }catch(Exception e){
        e.printStackTrace();
	logger.error(e);
      }
       return list;
    }
    
       

}
